class Api::V1::BeeCategoriesController < Api::V1::BaseController
  before_action :authenticate_request!

  def index
    render json: BeeCategory.all
  end

  def create
    begin
      @bee_category = BeeCategory.new(create_params)
      authorize @bee_category
      @bee_category.save!
      render json: @bee_category, status: 201
    rescue ActiveRecord::StatementInvalid
      @bee_category.errors.add(:exec_error, 'Contact Administrator')
      error_render(@bee_category, 403)
    rescue => err
      error_render(err.record, 403)
    end
  end

  private

  def create_params
    params_parse(params)
  end

end
